using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using PraxisRent.Repository.Mapping;
using PraxisRent.Entities;


namespace PraxisRent.Repository
{
    public partial class PRAXISRENTContext : DbContext
    {
        static PRAXISRENTContext()
        {
            Database.SetInitializer<PRAXISRENTContext>
                (
                null
                //new DropCreateDatabaseIfModelChanges<PRAXISRENTContext>()
                //new DropCreateDatabaseAlways<PRAXISRENTContext>()
                //new PraxisRentDatabaseInitializer()
                );
        }

        public PRAXISRENTContext()
            : base("Name=PRAXISRENTContext")
        {
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ProxyCreationEnabled = false;
            this.Configuration.AutoDetectChangesEnabled = false;
        }

        public DbSet<ALQUILER> ALQUILERs { get; set; }
        public DbSet<CLIENTE> CLIENTEs { get; set; }
        public DbSet<CREDITO> CREDITOs { get; set; }
        public DbSet<DETALLE_ALQUILER> DETALLE_ALQUILER { get; set; }
        public DbSet<DETALLE_CREDITO> DETALLE_CREDITO { get; set; }
        public DbSet<DETALLE_DEVOLUCION> DETALLE_DEVOLUCION { get; set; }
        public DbSet<DETALLE_ENTREGA> DETALLE_ENTREGA { get; set; }
        public DbSet<DEVOLUCION> DEVOLUCIONs { get; set; }
        public DbSet<OPERADOR> OPERADOR { get; set; }
        public DbSet<ENTREGA> ENTREGAs { get; set; }
        public DbSet<EQUIPO> EQUIPOes { get; set; }
        public DbSet<OBRA> OBRAs { get; set; }
        public DbSet<PAGO> PAGOes { get; set; }
        public DbSet<MARCA> MARCAs { get; set; }
        public DbSet<COLOR> COLORes { get; set; }
        public DbSet<TIPO_EQUIPO> TIPO_EQUIPOes { get; set; }
        public DbSet<TIPO_PAGO> TIPO_PAGOes { get; set; }
        public DbSet<TIPO_COMPROBANTE> TIPO_COMPROBANTEs { get; set; }
        public DbSet<TELEFONO_CLIENTE> TELEFONO_CLIENTEs { get; set; }
        public DbSet<PERSONA> PERSONAs { get; set; }
        public DbSet<ESTADO_CIVIL> ESTADO_CIVILs { get; set; }
        public DbSet<SEXO> SEXOs { get; set; }
        public DbSet<MENU> MENUs { get; set; }
        public DbSet<ROL> ROLs { get; set; }
        public DbSet<USUARIO> USUARIOs { get; set; }
        public DbSet<USUARIO_MENU> USUARIO_MENUs { get; set; }
        public DbSet<TELEFONO_PERSONA> TELEFONO_PERSONAs { get; set; }
        public DbSet<CLIENTE_NATURAL> CLIENTE_NATURALs { get; set; }
        public DbSet<CLIENTE_JURIDICO> CLIENTE_JURIDICOs { get; set; }
        public DbSet<FOTO_PERSONA> FOTO_PERSONA { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new ALQUILERMap());
            modelBuilder.Configurations.Add(new CLIENTEMap());
            modelBuilder.Configurations.Add(new CREDITOMap());
            modelBuilder.Configurations.Add(new DETALLE_ALQUILERMap());
            modelBuilder.Configurations.Add(new DETALLE_CREDITOMap());
            modelBuilder.Configurations.Add(new DETALLE_DEVOLUCIONMap());
            modelBuilder.Configurations.Add(new DETALLE_ENTREGAMap());
            modelBuilder.Configurations.Add(new DEVOLUCIONMap());
            modelBuilder.Configurations.Add(new OPERADORMap());
            modelBuilder.Configurations.Add(new ENTREGAMap());
            modelBuilder.Configurations.Add(new EQUIPOMap());
            modelBuilder.Configurations.Add(new OBRAMap());
            modelBuilder.Configurations.Add(new PAGOMap());
            modelBuilder.Configurations.Add(new MARCAMap());
            modelBuilder.Configurations.Add(new COLORMap());
            modelBuilder.Configurations.Add(new TIPO_COMPROBANTEMap());
            modelBuilder.Configurations.Add(new TIPO_EQUIPOMap());
            modelBuilder.Configurations.Add(new TIPO_PAGOMap());
            modelBuilder.Configurations.Add(new TELEFONO_CLIENTEMap());
            modelBuilder.Configurations.Add(new PERSONAMap());
            modelBuilder.Configurations.Add(new SEXOMap());
            modelBuilder.Configurations.Add(new ESTADO_CIVILMap());
            modelBuilder.Configurations.Add(new MENUMap());
            modelBuilder.Configurations.Add(new ROLMap());
            modelBuilder.Configurations.Add(new USUARIOMap());
            modelBuilder.Configurations.Add(new USUARIO_MENUMap());
            modelBuilder.Configurations.Add(new TELEFONO_PERSONAMap());
            modelBuilder.Configurations.Add(new CLIENTE_NATURALMap());
            modelBuilder.Configurations.Add(new CLIENTE_JURIDICOMap());
            modelBuilder.Configurations.Add(new FOTO_PERSONAMap());
        }
    }
}
